﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TiebaSpider.Beans
{
    public class Options
    {
        public long MinSizeLimitation { get; set; }
        public int MinWidthLimitation { get; set; }
        public int MinHeightLimitation { get; set; }
        public string StorageDirectory { get; set; }
        public bool StoreInSubdirectory { get; set; }
        public int TaskBatchSize { get; set; }
		public int PagePartition { get; set; }
		public int CrawlerTimeout { get; set; }
		public bool HideExists { get; set; }

        public readonly long DEFAULT_SIZE_MINIMUM_LIMITATION = 50L;
        public readonly int DEFAULT_WIDTH_MINIMUM_LIMITATION = 200;
        public readonly int DEFAULT_HEIGHT_MINIMUM_LIMITATION = 200;
        public readonly string DEFAULT_STORAGE_DIRECTORY;
        public readonly bool DEFAULT_STORE_IN_SUBDIRECTORY_SIGN = true;
        public readonly int DEFAULT_TASK_BATCH_SIZE = 50;
		public readonly int DEFAULT_PAGE_PARTITION_SIZE = 20;
		public readonly int DEFAULT_CRAWLER_TIME_OUT = 20000;
		public readonly bool DEFAULT_HIDE_EXISTS = true;

        public Options()
        {
            DEFAULT_STORAGE_DIRECTORY = System.Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);

            MinSizeLimitation = DEFAULT_SIZE_MINIMUM_LIMITATION;
            MinWidthLimitation = DEFAULT_WIDTH_MINIMUM_LIMITATION;
            MinHeightLimitation = DEFAULT_HEIGHT_MINIMUM_LIMITATION;
            StorageDirectory = DEFAULT_STORAGE_DIRECTORY;
            StoreInSubdirectory = DEFAULT_STORE_IN_SUBDIRECTORY_SIGN;
            TaskBatchSize = DEFAULT_TASK_BATCH_SIZE;
			PagePartition = DEFAULT_PAGE_PARTITION_SIZE;
			CrawlerTimeout = DEFAULT_CRAWLER_TIME_OUT;
			HideExists = DEFAULT_HIDE_EXISTS;
        }
    }
}
